<!DOCTYPE html>

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Editor</title>

    <linko rel="stylesheet" href="styles.css" type="text/css" media="screen" charset="utf-8">
</head>
<body>
    <div id="editor">
		<div id="toggleGutter" onclick="toggleGutter();"></div>
	</div>

	<script type="text/javascript" src='../../../../ace/demo/require.js'></script>
    <script type="text/javascript">
//add stub console since ace calls console.error
yui=1
/*if(!window.console){
	console={};
	console.log = console.error = function(){};
}*/
root='../../../../ace/demo/require.js'
require({
    paths: {
        fbace: "../../Acebug/chrome/content/fbace",
        ace: "../lib/ace",
        cockpit: "../support/cockpit/lib/cockpit",
        pilot: "../support/pilot/lib/pilot"
    }
});

var deps = [ "pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings",
             "pilot/environment", "fbace/startup" ];
console.log(deps)
var onLaunch
var startAce = function(callback, options) {
	if(onLaunch){
		onLaunch = onLaunch || callback
		return
	}
	onLaunch = callback || 'called';
	var rootDeps = deps;
	if(!options)
		options = {};
	//"ace/theme/textmate" is built into ace.js so there's no need to load that
	if(!options.theme)
		options.theme = "ace/theme/textmate";
	else if(options.theme != "ace/theme/textmate")
		rootDeps.push(options.theme);

	require(rootDeps, function() {
		var catalog = require("pilot/plugin_manager").catalog;
		catalog.registerPlugins([ "pilot/index" ]).then(function() {
			var env = require("pilot/environment").create();
			catalog.startupPlugins({ env: env }).then(function() {
				require("fbace/startup").launch(env, options);
			}).then(callback);
		});
	});
};
	</script>
</body>
</html>
